import { defHttp } from '/@/utils/http/axios';

enum Api {
  Crud = '/dict',
  Table = '/dict/table',
  List = '/dict/list',
  GetListByMark = '/dict/getListByMark',
}

export const getTableData = (params:any) => defHttp.get<DictItem[]>({ url: Api.Table, params: params });

export const getListData = () => defHttp.get<DictItem[]>({ url: Api.List });

export const getListByMark = (params:any) => defHttp.get<DictItem[]>({ url: Api.GetListByMark, params: params });

export const create = (params: any) => defHttp.post({url: Api.Crud, params});

export const update = (params: any) => defHttp.put({url: Api.Crud, params});

export const deletes = (params: number[]) => defHttp.delete({url: Api.Crud, data: params});

export interface DictItem {
  ID: number,
  enable: number,
  mark: string;
  code: string;
  label: string;
  tag: number;
  memo: string;
}

